#include <iostream>

#include <sqlite3.h>

#include "library.h"
#include "sqlite3pp/sqlite3pp.h"

void run(const std::string& root,
		 const std::string& dbpath)
{
	pita::Library lib(root, dbpath);
	lib.update();

	for (pita::Library::iterator itr = lib.begin();
		 itr != lib.end();
		 ++itr)
	{
		std::cout << itr.path() << " -> "
				  << itr.modtime() << "\n";
	}
}

int main(int argc, char** argv)
{
	try 
	{
		run(argv[1], argv[2]);
	}
	catch (const sqlite3pp::database_error& e)
	{
		std::cout << "database_error: " 
				  << e.what() << "\n";
		return 1;
	}
}
